<script setup>
import { ref, onMounted } from 'vue'
import { useUserStore } from '@/stores'
import { useGetTodayTasksService } from '@/api/task'

const userStore = useUserStore()
const { userId } = userStore

// 今日任务列表
const todayTasksList = ref([])

// 获取今日任务列表
const getTodayTasks = async () => {
  const res = await useGetTodayTasksService({ user_id: userId })
  todayTasksList.value = res.data.data
  console.log('今日任务列表' + JSON.stringify(todayTasksList.value))
}
// 页面加载时获取今日任务列表
onMounted(() => {
  getTodayTasks()
})
</script>

<template>
  <AddTasksContent @refreshTasks="getTodayTasks" :taskList="todayTasksList" classifyName="今天"></AddTasksContent>
</template>

<style lang="less" scoped>

</style>
